﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DTO
{
    public class KhachHangDTO
    {
        int _ID;
        String _HoTen,
            _DiaChi,
            _DienThoai,
            _Email;
        float _DuNo;

        public System.String Email
        {
            get { return _Email; }
            set { _Email = value; }
        }

        public float DuNo
        {
            get { return _DuNo; }
            set { _DuNo = value; }
        }

        public System.String DienThoai
        {
            get { return _DienThoai; }
            set { _DienThoai = value; }
        }

        public System.String DiaChi
        {
            get { return _DiaChi; }
            set { _DiaChi = value; }
        }

        public System.String HoTen
        {
            get { return _HoTen; }
            set { _HoTen = value; }
        }

        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }

        public KhachHangDTO()
        {
            _ID = 0;
            _HoTen = String.Empty;
            _DiaChi = String.Empty;
            _DienThoai = String.Empty;
            _Email = String.Empty;
            _DuNo = 0;
        }

         public KhachHangDTO(List<String> l)
        {
            _ID = int.Parse(l[0]);
            _HoTen = l[1];
            _DiaChi = l[2];
            _DienThoai = l[3];
            _Email = l[4];
            _DuNo = float.Parse(l[5]);
        }

         public KhachHangDTO(KhachHangDTO othr)
        {
            _ID = othr.ID;
            _HoTen = othr.HoTen;
            _DiaChi = othr.DiaChi;
            _DienThoai = othr.DienThoai;
            _Email = othr.Email;
            _DuNo = othr.DuNo;
        }

        public List<String> ToStringList()
        {
            List<String> r = new List<String>();
            r.Add(_ID.ToString());
            r.Add(_HoTen.ToString());
            r.Add(_DiaChi.ToString());
            r.Add(_DienThoai.ToString());
            r.Add(_Email.ToString());
            r.Add(_DuNo.ToString());

            return r;
        }
    }
}
